package com.by.web.controller;

import com.by.domain.vo.ResponseResult;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @auth wzy
 * @date 2024/1/2 9:41
 */
@Controller
public class HelloController {

    @GetMapping("/hello")
    @PreAuthorize("hasAuthority('hello')")
    @ResponseBody
    public String hello(){
        return "Hello";
    }



    @GetMapping("/userlist")
    @PreAuthorize("hasAuthority('system:user:list')")
    @ResponseBody
    public ResponseResult userList(){
        return new ResponseResult(HttpStatus.OK.value(),"userList");
    }
}
